package net.googlecode.garzha.services;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 02.06.11
 * Time: 0:26
 * To change this template use File | Settings | File Templates.
 */

 @Service
public class SecurityServiceImpl implements SecurityService{


  public String getCurrentUser(){

       Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();

   return ((UserDetails)principal).getUsername();


   };
}
